package id.co.shuba.spamobile.data;

import id.co.shuba.spamobile.model.AuditInfo;
import id.co.shuba.spamobile.model.Column;
import id.co.shuba.spamobile.model.PrimaryKey;
import id.co.shuba.spamobile.model.Table;

import java.lang.reflect.Field;

import android.content.ContentValues;
import android.database.sqlite.SQLiteDatabase;

public class AuditDB extends BaseDB {	
	
	public AuditDB(DatabaseHandler db) {
		super(db);
	}			
	
	public void add(AuditInfo info) {
		ContentValues values = new ContentValues();
		values.put("ACT_TYPE", info.getActType());
		values.put("TABLE_NAME", info.getTableName());
		values.put("PRIMARY_KEY", info.getPrimaryKey());
		values.put("FIELD_NAME", info.getFieldName());
		values.put("OLD_VALUE", info.getOldValue());
		values.put("NEW_VALUE", info.getNewValue());
		values.put("UPDATE_BY", info.getUpdateBy());		
		values.put("UPDATE_DATE", info.getUpdateDate());		

		SQLiteDatabase db = _db.getWritableDatabase();

		db.insert("TBL_AUDIT", null, values);
	}			
}
